-- equip_complete_attrib
-- created by zhuangsl
-- 穿齐装备提升属性

return {
    apply = function(prop, baseValue)
        return prop[3];
    end,

    trigger = function(who, prop, value)
        if who.type ~= OBJECT_TYPE_USER then
            return 0;
        end
        
        local count = 0;
        local equipments = ME.user.equipments;

        -- 没有装备
        if not equipments or #table.keys(equipments) <= 0 then
            return 0;
        end

        -- 遍历每个部位
        for _, equiped in pairs(equipments) do
            if #equiped > 0 then
                count = count + 1;
            end
        end
        
        -- 没穿齐
        if count < 9 then
            return 0;
        end
        
        -- 千分比提升
        value = math.modf(value * prop[3] / 1000);

        return value;
    end,

    record = function(target, prop, path)
        return false;
    end 
};